Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict css-minimizer-webpack-plugin version in the generator unless using Node v18+ #1598

Merged

Conversation

ahangarha
Copy link
Contributor

@ahangarha ahangarha commented Jan 21, 2024

Summary

Recently css-minimizer-webpack-plugin released v6.0.0 in which the minimum required Node version is 18.

We install this package in our generator, and we need this PR to ensure our generator doesn't break in an environment with an older Node.

⚠️ We may need to make a release after this merge.

Alternatively, we can bump our Nodejs support to v18 (the current LTS)

I have change the generator so that it limits the version of this package unless we use Node v18+.

Pull Request checklist

  • Add/update test to cover these changes
  • Update documentation
  • Update CHANGELOG file

Other Information


This change is Reviewable

@ahangarha ahangarha marked this pull request as ready for review January 21, 2024 15:53
@ahangarha ahangarha requested a review from justin808 January 21, 2024 15:54
@@ -91,7 +91,8 @@ def add_yarn_dependencies
babel-plugin-macros"

puts "Adding CSS handlers"
run "yarn add css-loader css-minimizer-webpack-plugin mini-css-extract-plugin style-loader"
# css-minimizer-webpack-plugin v6.0.0 requires Node 18+
Copy link
Member

@justin808 justin808 Jan 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 100% the wrong thing to do. We should not be doing things like this to fix testing...Instead, just take Node 16 out of the test matrix.

We're not requiring an update to Node. Node 16 should still work with React on Rails.

Please confirm that the error is easy to debug if somebody uses the generator with old Node.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahangarha you could actually make the version of css-minimizer-webpack-plugin installed conditional on the version of node that is being used.

Have the generator check the result of node -v & then install the latest version of css-minimizer-webpack-plugin compatible with that node version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds better 👍🏾

@ahangarha
Copy link
Contributor Author

I close this PR regarding this comment. The required change is applied in #1592

@ahangarha ahangarha closed this Jan 22, 2024
@ahangarha ahangarha deleted the restrict-css-minimizer-webpack-plugin-version-below-6 branch January 22, 2024 15:11
@ahangarha ahangarha restored the restrict-css-minimizer-webpack-plugin-version-below-6 branch January 23, 2024 12:28
@ahangarha ahangarha reopened this Jan 23, 2024
@ahangarha ahangarha changed the title Restrict css-minimizer-webpack-plugin version below 6 in the generator Restrict css-minimizer-webpack-plugin version in the generator unless using Node v18+ Jan 23, 2024
@ahangarha ahangarha mentioned this pull request Jan 23, 2024
@justin808 justin808 merged commit f5c34d4 into master Jan 24, 2024
38 checks passed
@justin808 justin808 deleted the restrict-css-minimizer-webpack-plugin-version-below-6 branch January 24, 2024 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants